@extends('layouts.admin')

@section('title', '死宅博客首页' )



@section('content')

      <!--sidebar end-->
      
      <!-- **********************************************************************************************************************************************************
      MAIN CONTENT
      *********************************************************************************************************************************************************** -->
   <section id="main-content">
          <section class="wrapper">
            <h3><i class="fa fa-angle-right"></i>权限管理</h3>
            <!-- BASIC FORM ELELEMNTS -->
            <div class="row mt">
                <div class="col-lg-12">
                  <div class="form-panel">
                        <h4 class="mb"><i class="fa fa-angle-right"></i>编辑权限</h4>
                        <form class="form-horizontal style-form" method="post" action="{{route('admin.permission.update')}}">
                            {{ csrf_field() }}
                            <input type="hidden" value="{{$per->id}}" name="id">
                            <div class="form-group">
                                <label class="col-sm-2 col-sm-2 control-label">权限标识</label>
                                <div class="col-sm-10">
                                    <input type="text"  class="form-control" name="name" id="name"  placeholder="唯一标识如admin.role.xxx" value="{{$per->name}}">
                                    <lable class="error error_name"   style="display: inline-block;">{{$errors->first('name')}}</lable>
                                </div>
                                
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 col-sm-2 control-label">权限名称</label>
                                <div class="col-sm-10">
                                    <input type="text"  class="form-control" name="display_name" id="display_name" placeholder="请输入权限名称" value="{{$per->display_name}}">
                                    <lable class="error error_display_name"   style="display: inline-block;">{{$errors->first('display_name')}}</lable>
                                </div>
                                
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 col-sm-2 control-label">权限描述</label>
                                <div class="col-sm-10">
                                    <input type="text"  class="form-control" name="description" id="description" placeholder="请输入描述" value="{{$per->description}}">
                                    <lable class="error error_description"   style="display: inline-block;">{{$errors->first('description')}}</lable>
                                </div>
                               
                               
                            </div>
                            
                            <div class="form-group">
                                <label class="col-sm-2 col-sm-2 control-label">所属栏目</label>
                                <div class="col-sm-10">
                                        <select class="form-control" name="cid">
                                            <option value="0"></option>
                                            @foreach($tree as $v)
                                                <option value="{{$v['id']}}" @if($per->cid==$v['id']) selected="selected" @endif>{{$v['display_name']}}</option>
                                               
                                            @endforeach
                                        </select>
                                </div>
                               
               
                            </div>

                            <button type="submit" class="btn btn-theme02"><i class="fa fa-check"></i>提交</button>
                        </form>
                  </div>
                </div><!-- col-lg-12-->         
            </div><!-- /row -->
       
  
            
            
        </section>
      </section><!-- /MAIN CONTENT -->
  
@endsection

 @section('script')
    <script src="{{asset('assets/assets/js/jquery.validate.js')}}"></script>
    <script src="{{asset('assets/js/quanxian.js')}}"></script>
@endsection